package com.mianyang.zhangsan.controller;


import com.mianyang.zhangsan.common.base.BaseController;
import com.mianyang.zhangsan.common.base.R;
import com.mianyang.zhangsan.model.dto.SecGrantRoleDto;
import com.mianyang.zhangsan.model.entity.SecUserRole;
import com.mianyang.zhangsan.service.ISecUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *
 * @author jiangjr
 * @since 2022-10-23
 */
@RestController
@RequestMapping("/position")
public class SecUserRoleController extends BaseController {
    @Autowired
    private ISecUserRoleService userRoleService;

    /**
     * 任命用户（为用户关联角色）
     */
    @PostMapping
    public R grantRole(@RequestBody SecUserRole userRole){
        String tip = userRoleService.grantToUser(userRole);
        return success("tip", tip);
    }
}
